<?php
/*
  $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

  E-Commerce Solutions

  Copyright (c) 2005 www.flash-template-design.com

  Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
  if (WARN_INSTALL_EXISTENCE == 'true') {
    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
    }
  }

// check if the configure.php file is writeable
  if (WARN_CONFIG_WRITEABLE == 'true') {
    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
    }
  }

// check if the session folder is writeable
  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
    if (STORE_SESSIONS == '') {
      if (!is_dir(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
      } elseif (!is_writeable(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
      }
    }
  }

// check session.auto_start is disabled
  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
    if (ini_get('session.auto_start') == '1') {
      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
    }
  }

  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
    if (!is_dir(DIR_FS_DOWNLOAD)) {
      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
    }
  }

  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }  
?>
<center>
<table border="0" width="800" height="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td height="111" colspan="3" align="left">
			<table width="800" style="border:1px solid #DED9C5;" height="111" cellspacing="0" cellpadding="0">
				<tr>
				    <td>
						<table width="798" style="border:1px solid #ffffff;" height="109" cellspacing="0" cellpadding="0" border="0">
							<tr>
							    <td>
									<table height="107" width="796" cellspacing="0" cellpadding="0" border="0">
										<tr>
										    <td height="107" width="285" class="logo"><img src="images/pixel_trans.gif" alt="" width="1" height="1" border="0"></td>
										    <td height="107" width="276" class="header_bg">
												<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
													<tr>
													    <td height="50%" align="left" valign="middle">
															<table width="100%"  cellspacing="0" cellpadding="0" border="0">
																<tr>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_ABOUT_US) ?>"><?php echo HEADER_TITLE_ABOUT_US; ?></a></td>
																</tr>
																<tr>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_SHIPPING) ?>"><?php echo HEADER_TITLE_SHIPPING; ?></a></td>
																</tr>
																<tr>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_RETURNS) ?>"><?php echo HEADER_TITLE_RETURNS; ?></a></td>
																</tr>
															</table>
														</td>
													    <td height="50%" align="right" valign="middle">
															<table width="100%"  cellspacing="0" cellpadding="0" border="0">
																<tr>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH) ?>"><?php echo HEADER_TITLE_ADVANCED_SEARCH; ?></a></td>
																</tr>
																<tr>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT) ?>"><?php echo HEADER_TITLE_CREATE_ACCOUNT; ?></a></td>
																</tr>
																<tr>
																<?php if (tep_session_is_registered('customer_id')) { ?>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_LOGOFF) ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></td>
																<?php } else { ?>
																	<td align="left" style="padding-left:0px; padding-right:5px;"><img src="images/str-list.gif" hspace="0" alt="" width="4" height="11" border="0"></td><td class="atopmenu" style="padding-top:1px; padding-bottom:1px;"  align="left"><a href="<?php echo tep_href_link(FILENAME_LOGIN) ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></td>
																<?php } ?>
																</tr>
															</table>

														</td>
													</tr>
													<tr>
													    <td colspan="2" align="left"><table border="0" cellpadding="0" cellspacing="0" width="98%" height="1"><tr><td background="images/point_bg.gif" align="left"><IMG height="1" src="images/point_bg.gif" width="3" alt="" /></td></table></td>
													</tr>
													<tr>
														<td colspan="2">
															<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
																<tr>
																	<td align="left">
            															<table cellspacing="0" cellpadding="0" border="0" style="margin-left:0px;">
            																<tr>
            																	<td align="left" valign="middle" width="100%" height="100%" style=" letter-spacing: 0px; font:10px Tahoma, Arial,  Helvetica, sans-serif; color:#BA0001;">
            																	<?php echo BOX_HEADING_LANGUAGES ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
            																	<?php include(DIR_WS_BOXES . 'languages.php'); ?></td>
            																</tr>
            															</table>
            														</td>
            													    <td align="left" valign="middle">
            														<?php include(DIR_WS_BOXES . 'currencies.php');?>
            														</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
										    <td height="107" width="235" class="logo2"><img src="images/pixel_trans.gif" alt="" width="1" height="1" border="0"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>	
	</tr>
	<tr>
		<td height="21" colspan="3" align="left">
			<table width="800" height="19" style="border:1px solid #870706;" class="menu" cellspacing="0" cellpadding="0">
				<tr>
				    <td align="center">
						<a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><? echo HEADER_TITLE_HOME_UC ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
					    <a href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL'); ?>"><? echo HEADER_TITLE_PRODUCTS_NEW_UC ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
					    <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT_UC ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
					    <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><? echo HEADER_TITLE_SHOPPING_CART_UC ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
					    <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><? echo HEADER_TITLE_CHECKOUT_UC ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;
					    <a href="<?php echo tep_href_link(FILENAME_CONTACT_US); ?>"><?php echo HEADER_TITLE_CONTACTS_UC ?></a></td>
				</tr>
			</table>
		</td>
	</tr>
